#pragma once

#include "znx_http_request.h"

znx_result_t znx_http_seal_request_header(znx_http_request_t *request,
    znx_buf_t **header_buf_p);

// pack the request header into buf and try to call write once.
znx_result_t znx_http_send_request_header(znx_http_request_t *request);

void znx_http_start_send_request_body(znx_http_request_t *request,
    znx_http_request_handler_t notify_handler, void *data);

void znx_http_enable_send_request_body(znx_http_request_t *request);

void znx_http_disable_send_request_body(znx_http_request_t *request);

void znx_http_set_send_request_body_done(znx_http_request_t *request);

void znx_http_start_read_response_headers(znx_http_request_t *request,
    znx_http_request_handler_t done_handler, void *data);

void znx_http_start_read_response_body(znx_http_request_t *request,
    znx_http_request_handler_t notify_handler, void *data);

void znx_http_enable_read_response_body(znx_http_request_t *request);

void znx_http_disable_read_response_body(znx_http_request_t *request);
